<template>
  <view class="progress-box">
    <!-- 支持传入 pgList，默认显示第一个进度 -->
    <progress
      :percent="pgList[0]"
      show-info
      :stroke-width="strokeWidth"
      active
      :color="color"
      :background-color="backgroundColor"
    />
  </view>
</template>

<script>
export default {
  name: "ProgressBar",
  props: {
    pgList: {
      type: Array,
      default: () => [0] // 默认 0%
    },
    strokeWidth: {
      type: Number,
      default: 3
    },
    color: {
      type: String,
      default: "#4caf50"
    },
    backgroundColor: {
      type: String,
      default: "#f0f0f0"
    }
  }
};
</script>

<style scoped>
.progress-box {
  margin: 10px 0;
}
</style>
